<?php

class IndexAction extends Action {

    public function index(){
    	session_start();
		$login = new UserModel();
		$sub = $login->create();
		$name = $sub['name'];
		$pass = md5($sub['password']);
		$list = $login->where("name='$name' and password='$pass'")->select();
		if(empty($list[0])){
			$this->assign('login','登录失败');
		}else{
			$this->assign('login','登录成功');
		}
		$this->display();

    }
}
?>